package com.yf.dao;

import com.yf.bean.NoteBean;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class NoteDao extends BaseDao {
    public int addNote(NoteBean bean) {
        return sessionTemplate.insert(getStatement("addNote"), bean);
    }

    public int updateNote(NoteBean bean) {
        return sessionTemplate.update(getStatement("updateNote"), bean);
    }

    public int disableNote(Integer id) {
        return sessionTemplate.update(getStatement("disableNote"), id);
    }

    public List<NoteBean> getOwnerNote(Integer uid) {
        return sessionTemplate.selectList(getStatement("getOwnerNote"), uid);
    }

    public List<NoteBean> getQusNote(Integer pid) {
        return sessionTemplate.selectList(getStatement("getOwnerNote"), pid);
    }
}
